"""
7-5 成绩统计
编写程序，输入一批学生的成绩，遇负数表示输入结束，
要求统计并输出各等级成绩的学生个数。
成绩等级分为三级，分别为A（90~100）、P（60~89）、F（0~59）。
"""


# 非零返回？
def resolution1():
    count = [0] * 3  # 0代表A等、1代表P等、2代表F等
    marks = input().split(" ")
    marks.remove('')
    marks.remove('-1')
    num_marks = list(map(lambda mark: int(mark), marks))
    # print(num_marks
    for mark in num_marks:
        if 90 <= mark <= 100:
            count[0] += 1
        elif 60 <= mark <= 89:
            count[1] += 1
        elif 0 <= mark <= 59:
            count[2] += 1
    print(f"A等级{count[0]}人")
    print(f"P等级{count[1]}人")
    print(f"F等级{count[2]}人")


if __name__ == '__main__':
    resolution1()

# 我还是选择用Java写吧~
"""
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Integer[] levels = {0, 0, 0};
        Integer number;
        while (true)
        {
            number = scanner.nextInt();
            if (number == -1)
            {
                break;
            }
            if (90 <= number && number <= 100)
                levels[0] += 1;
            else if (60 <= number && number <= 89)
                levels[1] += 1;
            else if (0 <= number && number <= 59)
                levels[2] += 1;
        }
        System.out.println("A等级" + levels[0]+ "人");
        System.out.println("P等级" + levels[1]+ "人");
        System.out.println("F等级" + levels[2]+ "人");
        scanner.close();
    }
}
"""